const formJson = {
  state: {
    listData: [], // 选中的表格数据
    // 原始对象
    formObj: {},
    // 处理后的数据
    handleObj: {}
  },
  // 赋值
  mutations: {
    setListData: (state, value) => {
      state.listData = value
    },
    setFormObj: (state, value) => {
      if (value != null) {
        if (value.person.Apl_per_cnmedexam) {
          value.person.Apl_per_drope_cnmedexam = JSON.parse(JSON.stringify(value.person.Apl_per_cnmedexam))
          delete value.person.Apl_per_cnmedexam
        }
        if (value.person.Apl_per_enmedexam) {
          value.person.Apl_per_drope_enmedexam = JSON.parse(JSON.stringify(value.person.Apl_per_enmedexam))
          delete value.person.Apl_per_enmedexam
        }
        if (value.person.Apl_per_quamgrorg) {
          value.person.Apl_per_drope_quamgrorg = JSON.parse(JSON.stringify(value.person.Apl_per_quamgrorg))
          delete value.person.Apl_per_quamgrorg
        }
        if (!value.CUSTOM) {
          value.CUSTOM = {
            new: {
              attrForm: {
                apltable: '',
                title: '',
                table: '',
                yjctable: '',
                type: 'single',
                autoacho: 'true',
                params: {},
                paramsList: [],
                filter: {},
                fiterList: []
              },
              filedList: [],
              auto: false
            }
          }
        }
        if (!value.DROP.DRPROTYPE) {
          value.DROP.DRPROTYPE = {
            attrForm: {
              title: '药品生产分类码',
              type: 'single',
              table: '',
              ismultiple: 'false',
              isfaname: 'false',
              isaddonly: 'false',
              isreduceonly: 'false',
              filter: {},
              fiterList: []
            },
            filedList: [],
            auto: false
          }
        }
        state.formObj = value
      } else {
        state.formObj = {
          // 基本信息
          base: {
            // 企业信息
            ent: {
              attrForm: {
                apltable: 'apl_main',
                title: '企业信息',
                table: 'ent_sso',
                yjctable: '',
                type: 'single',
                autoacho: 'true',
                params: {},
                paramsList: [],
                filter: {},
                fiterList: []
              },
              filedList: [],
              auto: true
            },
            // 联系人信息
            link: {
              attrForm: {
                apltable: 'apl_link',
                title: '联系人信息',
                table: 'ent_linkman',
                yjctable: '',
                type: 'single',
                autoacho: 'true',
                params: {},
                paramsList: [],
                filter: {},
                fiterList: []
              },
              filedList: [],
              auto: true
            },
            // 邮寄信息
            send: {
              attrForm: {
                apltable: 'apl_send',
                title: '邮寄信息',
                table: 'ent_mail',
                yjctable: '',
                type: 'single',
                autoacho: 'true',
                params: {},
                paramsList: [],
                filter: {},
                fiterList: []
              },
              filedList: [],
              auto: true
            }
          },
          // 人员信息
          person: {
            // 法人
            LEGAL: {
              attrForm: {
                apltable: 'apl_per_legal',
                title: '法定代表人',
                table: '',
                yjctable: '',
                type: 'single',
                autoacho: 'true',
                emptybtn: 'false',
                params: {},
                paramsList: [],
                filter: {},
                fiterList: []
              },
              filedList: [],
              auto: false
            },
            // 企业负责人
            ENTMGR: {
              attrForm: {
                apltable: 'apl_per_entmgr',
                title: '企业负责人',
                table: '',
                yjctable: '',
                type: 'single',
                autoacho: 'true',
                emptybtn: 'false',
                params: {},
                paramsList: [],
                filter: {},
                fiterList: []
              },
              filedList: [],
              auto: false
            },
            // 生产负责人
            WORKMGR: {
              attrForm: {
                apltable: 'apl_per_workmgr',
                title: '生产负责人',
                table: '',
                yjctable: '',
                type: 'single',
                autoacho: 'true',
                emptybtn: 'false',
                params: {},
                paramsList: [],
                filter: {},
                fiterList: []
              },
              filedList: [],
              auto: false
            },
            // 质量负责人
            QUAMGR: {
              attrForm: {
                apltable: 'apl_per_quamgr',
                title: '质量负责人',
                table: '',
                yjctable: '',
                type: 'single',
                autoacho: 'true',
                emptybtn: 'false',
                params: {},
                paramsList: [],
                filter: {},
                fiterList: []
              },
              filedList: [],
              auto: false
            },
            // 技术负责人
            TECMGR: {
              attrForm: {
                apltable: 'apl_per_tecmgr',
                title: '技术负责人',
                table: '',
                yjctable: '',
                type: 'single',
                autoacho: 'true',
                emptybtn: 'false',
                params: {},
                paramsList: [],
                filter: {},
                fiterList: []
              },
              filedList: [],
              auto: false
            },
            // 管理者代表
            REPMGR: {
              attrForm: {
                apltable: 'apl_per_repmgr',
                title: '管理者代表',
                table: '',
                yjctable: '',
                type: 'single',
                autoacho: 'true',
                emptybtn: 'false',
                params: {},
                paramsList: [],
                filter: {},
                fiterList: []
              },
              filedList: [],
              auto: false
            },
            // 机构负责人
            Apl_per_drope_quamgrorg: {
              attrForm: {
                apltable: 'apl_per_drope_quamgrorg',
                title: '质量管理机构负责人信息',
                table: '',
                yjctable: '',
                type: 'single',
                autoacho: 'true',
                emptybtn: 'false',
                params: {},
                paramsList: [],
                filter: {},
                fiterList: []
              },
              filedList: [],
              auto: false
            },
            // 西药审方员
            Apl_per_drope_enmedexam: {
              attrForm: {
                apltable: 'apl_per_drope_enmedexam',
                title: '申请西药审方员信息',
                table: '',
                yjctable: '',
                type: 'single',
                autoacho: 'true',
                emptybtn: 'false',
                params: {},
                paramsList: [],
                filter: {},
                fiterList: []
              },
              filedList: [],
              auto: false
            },
            // 中药审方员
            Apl_per_drope_cnmedexam: {
              attrForm: {
                apltable: 'apl_per_drope_cnmedexam',
                title: '申请中药审方员信息',
                table: '',
                yjctable: '',
                type: 'single',
                autoacho: 'true',
                emptybtn: 'false',
                params: {},
                paramsList: [],
                filter: {},
                fiterList: []
              },
              filedList: [],
              auto: false
            }
          },
          // 厂区信息
          FACTORY: {
            attrForm: {
              title: '厂区信息',
              type: 'single'
            },
            filedList: [],
            auto: false
          },
          // 通用模态框
          GENERAL: {
            attrForm: {
              apltable: '',
              title: '通用模态框',
              type: 'multiple',
              isprodname: 'false'
            },
            filedList: [],
            auto: false
          },
          // 列表模态框
          LIST: {},
          // 下拉模态框
          DROP: {
            PRODSCOPE: {
              attrForm: {
                title: '生产范围',
                type: 'single',
                ismultiple: 'false',
                isfaname: 'false',
                filter: {},
                fiterList: []
              },
              filedList: [],
              auto: false
            },
            std_eqPro_catelc: {
              attrForm: {
                title: '器械生产品种',
                type: 'single',
                ismultiple: 'false',
                isfaname: 'false',
                filter: {},
                fiterList: []
              },
              filedList: [],
              auto: false
            },
            std_eqPro_scope: {
              attrForm: {
                title: '器械生产范围',
                type: 'single',
                ismultiple: 'false',
                isfaname: 'false',
                filter: {},
                fiterList: []
              },
              filedList: [],
              auto: false
            },
            std_eqPro_opeScope: {
              attrForm: {
                title: '器械经营范围',
                type: 'single',
                ismultiple: 'false',
                isfaname: 'false',
                filter: {},
                fiterList: []
              },
              filedList: [],
              auto: false
            },
            std_drOpe_wholesaleScope: {
              attrForm: {
                title: '药品批发经营范围',
                type: 'single',
                ismultiple: 'false',
                isfaname: 'false',
                filter: {},
                fiterList: []
              },
              filedList: [],
              auto: false
            },
            std_drOpe_retailScope: {
              attrForm: {
                title: '药品零售经营范围',
                type: 'single',
                ismultiple: 'false',
                isfaname: 'false',
                filter: {},
                fiterList: []
              },
              filedList: [],
              auto: false
            },
            std_drOpe_whoAndretasaleScope: {
              attrForm: {
                title: '药品零售/批发经营范围',
                type: 'single',
                ismultiple: 'false',
                isfaname: 'false',
                filter: {},
                fiterList: []
              },
              filedList: [],
              auto: false
            },
            std_copro_unit: {
              attrForm: {
                title: '化妆品产品单元',
                type: 'single',
                ismultiple: 'false',
                isfaname: 'false',
                filter: {},
                fiterList: []
              },
              filedList: [],
              auto: false
            },
            PREACCE: {
              attrForm: {
                title: '拟受理单位',
                type: 'single',
                table: '',
                ismultiple: 'false',
                isfaname: 'false',
                filter: {},
                fiterList: []
              },
              filedList: [],
              auto: false
            },
            MAP: {
              attrForm: {
                title: '经纬度',
                type: 'single',
                table: '',
                ismultiple: 'false',
                isfaname: 'false',
                filter: {},
                fiterList: []
              },
              filedList: [],
              auto: false
            },
            DRPROTYPE: {
              attrForm: {
                title: '药品生产分类码',
                type: 'single',
                table: '',
                ismultiple: 'false',
                isfaname: 'false',
                isaddonly: 'false',
                isreduceonly: 'false',
                filter: {},
                fiterList: []
              },
              filedList: [],
              auto: false
            }
          },
          // 自定义模态框
          CUSTOM: {
            // 企业信息
            new: {
              attrForm: {
                apltable: '',
                title: '',
                table: '',
                yjctable: '',
                type: 'single',
                autoacho: 'true',
                params: {},
                paramsList: [],
                filter: {},
                fiterList: []
              },
              filedList: [],
              auto: false
            }
          }
        }
      }
    },
    setHandleObj: (state, value) => {
      state.handleObj = value
    }
  },
  // 初始化
  actions: {},

  // 取值
  getters: {}
}

export default formJson
